#pragma once
#include "sapi.h"

#include <vector>
#include <string>

class SAPINotifySink :
	public ISpNotifySink
{
public:
	SAPINotifySink(void);
	~SAPINotifySink(void);

	HRESULT STDMETHODCALLTYPE QueryInterface(const IID& riid, void** ppvObject);
	ULONG STDMETHODCALLTYPE AddRef();
	ULONG STDMETHODCALLTYPE Release();
	HRESULT STDMETHODCALLTYPE Notify();

	void Speak(WCHAR* message);

	std::wstring lastMessage;
	ISpRecoContext* pRecoContext;
	ISpVoice* pVoice;	
	ISpStream* pStream;
	std::vector<short> samples;
	volatile bool done;

	long startTime;
	long inputStartedTime;
	long stopTime;

private:
	int refCount;
};
